from rest_framework import status
from rest_framework.exceptions import APIException

from urlth.StaticMessages import *


class UserPhoneRepeatCount(APIException):
    default_detail = errorMessage.PhoneRepeat
    status_code = status.HTTP_400_BAD_REQUEST
    default_code = "phone_code_Repeat"


class UserInfoNotFound(APIException):
    default_detail = errorMessage.phoneNotFound
    status_code = status.HTTP_404_NOT_FOUND
    default_code = "userinfo_not_found"


class UserPasswordError(APIException):
    default_detail = errorMessage.phonePassword
    status_code = status.HTTP_401_UNAUTHORIZED
    default_code = "userinfo_password_error"


class UserNotLoginError(APIException):
    default_detail = errorMessage.UserTokenError
    status_code = status.HTTP_403_FORBIDDEN
    default_code = "user_not_login_error"


class UserLoginPermissionError(APIException):
    default_detail = errorMessage.userLoginHeaderExamined
    default_code = "user_login_header_exampled"
    status_code = status.HTTP_431_REQUEST_HEADER_FIELDS_TOO_LARGE
